//
//  YCLStatusBottomView.swift
//  新浪微博01
//
//  Created by yaochunlin on 16/4/15.
//  Copyright © 2016年 yaochunlin. All rights reserved.
//

import UIKit

class YCLStatusBottomView: UIView {

    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override init(frame: CGRect) {
        
        super.init(frame: frame)
        
        prepareUI()
    }
    
    //设置UI
    private func prepareUI() {
    
        //添加控件
        addSubview(retweetBtn)
        addSubview(commentBtn)
        addSubview(likeBtn)
        addSubview(seperateView1)
        addSubview(seperateView2)
        
        //添加约束
        
        //转发按钮
        retweetBtn.snp_makeConstraints { (make) in
            make.top.leading.bottom.equalTo(self)
        }
        
        //评论按钮
        commentBtn.snp_makeConstraints { (make) in
            make.top.bottom.equalTo(self)
            make.leading.equalTo(retweetBtn.snp_trailing)
            make.width.equalTo(retweetBtn)
        }
        
        //点赞按钮
        likeBtn.snp_makeConstraints { (make) in
            
            make.top.trailing.bottom.equalTo(self)
            make.leading.equalTo(commentBtn.snp_trailing)
            make.width.equalTo(retweetBtn)
        }
        
        //分隔线1
        seperateView1.snp_makeConstraints { (make) in
            
            make.centerY.equalTo(retweetBtn)
            make.leading.equalTo(retweetBtn.snp_trailing)
        }
        
        //分隔线2
        seperateView2.snp_makeConstraints { (make) in
            
            make.centerY.equalTo(commentBtn)
            make.leading.equalTo(commentBtn.snp_trailing)
        }
        
        
    }
    
    
    //懒加载控件
    //转发
    private lazy var retweetBtn: UIButton = UIButton.init(imageName: "timeline_icon_retweet", title: "转发")
//    private lazy var retweetBtn: UIButton = {
//    
//        let btn = UIButton()
//        
//        //设置按钮背景
//        btn.setBackgroundImage(UIImage.init(named: "timeline_card_bottom_background"), forState: UIControlState.Normal)
//        btn.setBackgroundImage(UIImage.init(named: "timeline_card_bottom_background_highlighted"), forState: UIControlState.Highlighted)
//        //设置按钮图片
//        btn.setImage(UIImage.init(named: "timeline_icon_retweet"), forState: UIControlState.Normal)
//        
//        //设置按钮标题
//        btn.setTitle("转发", forState: UIControlState.Normal)
//        btn.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
//        btn.titleLabel?.font = UIFont.systemFontOfSize(YCLStatusTimeFontSize)
//        
//        return btn
//    }()
    
    //评论
        private lazy var commentBtn: UIButton = UIButton.init(imageName: "timeline_icon_comment", title: "评论")
//    private lazy var commentBtn: UIButton = {
//        
//        let btn = UIButton()
//        
//        //设置按钮背景
//        btn.setBackgroundImage(UIImage.init(named: "timeline_card_bottom_background"), forState: UIControlState.Normal)
//        btn.setBackgroundImage(UIImage.init(named: "timeline_card_bottom_background_highlighted"), forState: UIControlState.Highlighted)
//        //设置按钮图片
//        btn.setImage(UIImage.init(named: "timeline_icon_comment"), forState: UIControlState.Normal)
//        
//        //设置按钮标题
//        btn.setTitle("评论", forState: UIControlState.Normal)
//        btn.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
//        btn.titleLabel?.font = UIFont.systemFontOfSize(YCLStatusTimeFontSize)
//        
//        return btn
//    }()
    
    //赞
    private lazy var likeBtn: UIButton = UIButton.init(imageName: "timeline_icon_unlike", title: "赞")
//    private lazy var likeBtn: UIButton = {
//        
//        let btn = UIButton()
//        
//        //设置按钮背景
//        btn.setBackgroundImage(UIImage.init(named: "timeline_card_bottom_background"), forState: UIControlState.Normal)
//        btn.setBackgroundImage(UIImage.init(named: "timeline_card_bottom_background_highlighted"), forState: UIControlState.Highlighted)
//        //设置按钮图片
//        btn.setImage(UIImage.init(named: "timeline_icon_unlike"), forState: UIControlState.Normal)
//        
//        //设置按钮标题
//        btn.setTitle("赞", forState: UIControlState.Normal)
//        btn.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
//        btn.titleLabel?.font = UIFont.systemFontOfSize(YCLStatusTimeFontSize)
//        
//        return btn
//    }()
    
    //分割视图1
    private lazy var seperateView1:UIImageView = UIImageView.init(imageNamed: "timeline_card_bottom_line")
    
    //分割视图2
    private lazy var seperateView2:UIImageView = UIImageView.init(imageNamed: "timeline_card_bottom_line")


}
